package com.byxy.managerial.interceptor;


import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

/**
 * 登录拦截器
 * @author muxiangling
 *
 */
public class LoginInter extends AbstractInterceptor {
	private static final long serialVersionUID = 1L;

	@Override
	public String intercept(ActionInvocation invocation) throws Exception {	
		String username = (String) ActionContext.getContext().getSession().get("username");
		if (username == null || "".equals(username)) {
			return "ok";
		}
		return invocation.invoke();
	}

}
